﻿/*****************************************************************//**
 *
 * @file   FITKAbaqusAdaptorInteractionProperty.h
 * @brief  Abaqus Interaction 适配器 用于读取INP过程中的Interaction Property 解析。
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-04-18
 *
 *********************************************************************/
#ifndef __FITKABAQUSADAPTORINTERACTIONPROPERTY__H__
#define __FITKABAQUSADAPTORINTERACTIONPROPERTY__H__

#include "FITKAbaqusAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

 //前置声明
ForwardDeclarNS(AbaqusData, FITKDataCase)
ForwardDeclarNS(Interface, FITKAbaAssembly)
ForwardDeclarNS(Interface, FITKComponentManager)
ForwardDeclarNS(Interface, FITKAbaAbstractInteractionProperty)
ForwardDeclarNS(Interface, FITKAbaInteractionPropertyContact)
ForwardDeclarNS(Interface, FITKAbaInteractionContactBehavior)

namespace IO
{
    /**
     * @brief Abaqus 接触属性 读写适配器
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-03-26
     */
    class FITKAbaqusAdaptorInteractionProperty : public FITKAbaqusAbstractAdaptor
    {
    public:
        explicit FITKAbaqusAdaptorInteractionProperty() = default;
        ~FITKAbaqusAdaptorInteractionProperty() = default;


        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-03-26
         */
        QString getAdaptorClass() override;

        /**
         * @brief 设置算例数据对象
         * @param caseData
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-03-26
         */
        void setCaseData(AbaqusData::FITKDataCase* caseData);

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-03-26
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-03-26
         */
        bool adaptW() override;

    private:
        /**
         * @brief 读取相互作用属性-接触 和 几何属性(默认属性)
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-04-19
         */
        bool readInteractionPropertyContact();
        
        /**
         * @brief 写出相互作用属性-接触
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-04-22
         */
        bool writeInteractionPropertyContact();

    private:

        /**
         * @brief 算例数据
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-04-13
         */
        AbaqusData::FITKDataCase* _caseData{};
        /**
         * @brief 用于记录分析步是否是显式类型
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-04-23
         */
        bool _isExplicit{ false };
        /**
         * @brief 用于记录分析步是否是隐式类型
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-04-23
         */
        bool _isStandard{ false };
    };

    Register2FITKIOAdaptorFactory(INP, Interface::FITKAbaInteractionPropertyContact, FITKAbaqusAdaptorInteractionProperty);

}

#endif